package com.qingzhuge.sys.service.impl;

import com.qingzhuge.service.BasePkLongServiceImpl;
import com.qingzhuge.sys.dao.SysNoticeDao;
import com.qingzhuge.sys.entity.SysNotice;
import com.qingzhuge.sys.service.ISysNoticeService;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import java.util.List;

import static com.qingzhuge.sys.service.impl.SysNoticeServiceImpl.CACHE_NAME;

/**
 * @author : zero.xiao
 * @description :
 * @date :2018/7/11 0011 下午 12:13
 * @since : 1.0.0
 * @modified :
 */
@CacheConfig(cacheNames = CACHE_NAME)
@Service
public class SysNoticeServiceImpl extends BasePkLongServiceImpl<SysNoticeDao, SysNotice> implements ISysNoticeService {
    static final String CACHE_NAME = "SysNoticeService";

    @Override
    @Cacheable
    public List<SysNotice> findByType(String type) {
        if (null == type){
            return null;
        }
        return baseDao.findByType(type);
    }
}

